<template>
    <div>
        <page-header @toLastPage="toLastPage">
        <template v-slot:title>
        设置 
      </template>
        </page-header>
         <div class="information">
            <div v-for="(item,index) in settingList" :key="index">
  <cell-list :itemList="item"  @sendEvent='sendEvent'></cell-list>
    </div>
        </div>
        <van-button type="default" block>切换账号</van-button>
        <van-button type="default" block style="marginTop:.2rem;" @click="loginOut">退出</van-button>
    </div>
</template>
<script>
import pageHeader from '../common/pageHeader';
import cellList from '../common/cellList';
export default {
    components:{
        pageHeader,
        cellList
    },
     meteor: {
    $subscribe: {
      'userInf': []
    }
    },
    data() {
        return {
        settingList:[
         {
          separate:false,
         moreList:[
           {
              describe:'账号与安全',
              icon:'',
              content:'',
              event:''
           },
           {
              describe:'青少年模式',
              icon:'',
              content:'未开启',
              event:''
           }
        ]
        },
        {
          separate:false,
         moreList:[
           {
              describe:'新消息提醒',
              icon:'',
              content:'',
              event:''
           },
           {
              describe:'勿扰模式',
              icon:'',
              content:'',
              event:''
           },
           {
              describe:'聊天',
              icon:'',
              content:'',
              event:''
           },
           {
              describe:'隐私',
              icon:'',
              content:'',
              event:''
           },
           {
              describe:'通用',
              icon:'',
              content:'',
              event:''
           }
        ]
        },
         {
          separate:false,
         moreList:[
           {
              describe:'关于微信',
              icon:'',
              content:'',
              event:''
           },
           {
              describe:'帮助与反馈',
              icon:'',
              content:'',
              event:''
           }
        ]
        },
        ]
        }
    },
    methods:{
        toLastPage(){
            this.$router.go(-1)
        },
        sendEvent(e){
      switch(e){
        default:this.$notify({ type: 'success', message: '功能暂未开发',duration: 500 });break;
      }
    },
    loginOut(){
        this.$dialog.confirm({
            message: '确定要退出当前账号吗？',
            // confirmButtonColor:'#07C160'
            })
            .then(() => {
                sessionStorage.clear('user')
                this.$router.push('/login')
            })
            .catch(() => {
                // on cancel
            });
    }
    }
}
</script>
<style scoped>
      .information{
        margin-top: 1.5rem;
    }
</style>